package cn.com.cis.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.cis.domain.Privilege;
import cn.com.cis.domain.Role;
import cn.com.cis.domain.User;
import cn.com.cis.persistence.PrivilegeMapper;

@Service
@Transactional
public class PrivilegeService {

    @Autowired
    private PrivilegeMapper mapper;
    
    public void insertPrivilegeItem(Privilege privilege){
    	mapper.insertPrivilegeItem(privilege);
    }
    
    public void clearAll() {
		mapper.clearAll();
	}
    
    public List<Privilege> selectPrivileges() {
		return mapper.selectPrivileges();
	}
    
    public List<String> selectCurrentUserUrls(User user) {
		return mapper.selectCurrentUserUrls(user);
	}
    
    public List<String> selectRoleUrls(Role role) {
    	return mapper.selectRoleUrls(role);
    }

	public List<String> selectAdminUrls() {
		return mapper.selectAdminUrls();
	}

}
